package schooltest;


import school.Instructor;
import school.Student;
import school.course.AbstractSimpleCourse;
import school.course.Session;

public class SimpleCourse extends AbstractSimpleCourse {

	@Override
	public void addSession(Session session) {

	}

	@Override
	public boolean addStudent(Student student) {		
		if (student==null) {
			return true;
		}

		if (!students.contains(student)) {
			if (students.add(student)){
				return student.addCourse(this);
			}
			return false;
		}
		return true;
	}

	@Override
	public void removeStudent(Student student) {
		if (student==null) {
			return;
		}
		
		if (students.contains(student)) {
			students.remove(student);
			student.removeCourse(this);
		}
	}

	@Override
	public boolean setInstructor(Instructor instructor) {
		return true;
	}

	@Override
	public void setSessions(Session[] sessions) {
		// TODO Auto-generated method stub

	}

}
